package com.example.administrator.ksf_zty.util;

import android.content.Context;

import static com.example.administrator.ksf_zty.util.SharedPreferencesUtils.getParam;

/**
 * Created by Administrator on 2018/1/9.
 */

public class HttpUtils {

//    //外网IP地址
//    public  static String strHttpIP="";
//    //外网端口
//    public  static String strHttpPort="";
//    //接口地址
//    public  static String strHTTP_URL = "http://" +strHttpIP+ ":" + strHttpPort+ "/AndroidService.asmx/+";


    public static String strHTTP_URL11 = "http://192.168.0.140:8010/AndroidService.asmx/GetLogin_UserList";


//    public  static String strHTTP_URL11="http://211.103.182.221:8012/Service720.asmx/DownLoaddtgoods";

//    public  static  String StrHttp_URLGetLogin_UserList="http://192.168.0.126:8010/AndroidService.asmx/GetLogin_UserList";

    private String getBaseUrl() {
        return baseUrl;
    }

    private void setBaseUrl(String baseUrl) {
        this.baseUrl = baseUrl;
    }

    private String baseUrl;
    static String checkUpdate;
    static String downloadAdd;

    public static String StrHttp_URLGetLogin_UserList;//登录接口


    public static String StrHttp_URLGetZBBarCode;//获取栈板条码

    public static String StrHttp_URLZ_TRCE_H_DOWNLOAD_GRDOCUMENT_PDA;//下载退回供应商单据
    public static String StrHttp_URLZ_TRCE_H_UPLOAD_GRDOCUMENT_PDA;//上传退回供应商单据

    public static String StrHttp_URLZ_TRCE_H_DOWNLOAD_DELIVERY_PDA;//下载SAP关企出库单
    public static String StrHttp_URLZ_TRCE_H_UPLOAD_DELIVERY_PDA;//上传SAP关企出库单

    public static String StrHttp_URLZ_TRCE_H_DOWNLOAD_311DOCUMENT_PDA;//下载物料调拨出库
    public static String StrHttp_URLZ_TRCE_UPLOAD_311DOCUMENT_PDA;//上传物料调拨出库

    public static String StrHttp_URLZ_TRCE_H_DOWNLOAD_PRODORDER_PDA;//粉、酱、菜包入库扫描
    public static String StrHttp_URLZ_TRCE_H_UPLOAD_PRODORDER_ScanData_PDA;//上传粉、酱、菜包入库扫描数据

    public static String StrHttp_URLZ_TRCE_H_DOWNLOAD_RESERVATION_PDA; //下载SAP备料单
    public static String StrHttp_URLZ_TRCE_H_UPLOAD_RESERVATION_PDA;//上传备料单

    HttpUtils(Context context) {
        //动态获取设置的IP和端口（defaultObject是取值异常时使用的默认IP和端口）
        setBaseUrl("http://" + getParam(context, "ip", "192.168.0.140") + ":"
                + getParam(context, "port", "8010") + "/");
        String mainUrl = getBaseUrl() + "AndroidService.asmx/";
        checkUpdate = getBaseUrl() + "Version/ver.txt";//检查更新
        downloadAdd = getBaseUrl() + "Version/";//更新地址

        /**********用户模块**********/
        StrHttp_URLGetLogin_UserList = mainUrl + "GetLogin_UserList";//登录

        StrHttp_URLGetZBBarCode = mainUrl + "GetZBBarCode";//或者栈板条码数据

        /**********盐水房模块**********/


        /**********酱包前处理模块**********/


        /**********菜包处理模块**********/


        /**********单据处理模块*********/
        //原物料退回供应商接口配置
        StrHttp_URLZ_TRCE_H_DOWNLOAD_GRDOCUMENT_PDA = mainUrl + "Z_TRCE_H_DOWNLOAD_GRDOCUMENT_PDA";//退回供应商单据下载接口
        StrHttp_URLZ_TRCE_H_UPLOAD_GRDOCUMENT_PDA = mainUrl + "Z_TRCE_H_UPLOAD_GRDOCUMENT_PDA";//上传退回供应商单据

        //物料关企出库接口
        StrHttp_URLZ_TRCE_H_DOWNLOAD_DELIVERY_PDA = mainUrl + "Z_TRCE_H_DOWNLOAD_DELIVERY_PDA";//下载SAP关企出库单
        StrHttp_URLZ_TRCE_H_UPLOAD_DELIVERY_PDA = mainUrl + "Z_TRCE_H_UPLOAD_DELIVERY_PDA";//上传关企出库单据

        //物料调拨出库
        StrHttp_URLZ_TRCE_H_DOWNLOAD_311DOCUMENT_PDA = mainUrl + "Z_TRCE_H_DOWNLOAD_311DOCUMENT_PDA";//下载物料调拨出库
        StrHttp_URLZ_TRCE_UPLOAD_311DOCUMENT_PDA = mainUrl + "Z_TRCE_UPLOAD_311DOCUMENT_PDA";//上传物料调拨出库

        //粉、酱、菜包生产订单入库扫描
        StrHttp_URLZ_TRCE_H_DOWNLOAD_PRODORDER_PDA = mainUrl + "Z_TRCE_H_DOWNLOAD_PRODORDER_PDA"; //粉、酱、菜包入库扫描
        StrHttp_URLZ_TRCE_H_UPLOAD_PRODORDER_ScanData_PDA = mainUrl + "Z_TRCE_H_UPLOAD_PRODORDER_ScanData_PDA"; //上传粉、酱、菜包入库扫描数据

        //备料单,退料单
        StrHttp_URLZ_TRCE_H_DOWNLOAD_RESERVATION_PDA = mainUrl + "Z_TRCE_H_DOWNLOAD_RESERVATION_PDA";  //下载SAP备料单
        StrHttp_URLZ_TRCE_H_UPLOAD_RESERVATION_PDA = mainUrl + "Z_TRCE_H_UPLOAD_RESERVATION_PDA"; //上传备料单



    }
}
